<script>
var select2 = new Array(<?=count($provinceList)?>);
<?
foreach($provinceList as $v){echo 'select2['.$v['id'].'] = new Array();';foreach ($cityList[$v['id']] as $kk=>$vv ){?>select2[<?=$v['id']?>][<?=$kk?>] = new Option("<?=$vv['name']?>", "<?=$vv['id']?>");<?	}} ?>
function redirec(x,dx,city){
	var temp = dx; 
	temp.options.length=0;
	for (i=0;i<select2[x].length;i++){
		temp.options[i]=new Option(select2[x][i].text,select2[x][i].value);
		if (city>0){
			if (select2[x][i].value==city){
				temp.options[i].selected=true;
			}
		}
	}
}
</script>